<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>JSON Voorhees: jsonv::formats Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://www.mathjax.org/mathjax/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">JSON Voorhees
   </div>
   <div id="projectbrief">Killer JSON for C++</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classjsonv_1_1formats.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classjsonv_1_1formats-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">jsonv::formats Class Reference<div class="ingroups"><a class="el" href="group__Serialization.html">Serialization</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Simply put, this class is a collection of <code>extractor</code> and <code>serializer</code> instances.  
 <a href="classjsonv_1_1formats.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="serialization_8hpp_source.html">jsonv/serialization.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a827304b0c977f7ef178daff0f3e75a1a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a827304b0c977f7ef178daff0f3e75a1a"></a>
using&#160;</td><td class="memItemRight" valign="bottom"><b>list</b> = std::vector&lt; <a class="el" href="classjsonv_1_1formats.html">formats</a> &gt;</td></tr>
<tr class="separator:a827304b0c977f7ef178daff0f3e75a1a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:af0b63e3e4525b64c5aca47933f04f929"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1formats.html#af0b63e3e4525b64c5aca47933f04f929">formats</a> ()</td></tr>
<tr class="memdesc:af0b63e3e4525b64c5aca47933f04f929"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new, empty <code>formats</code> instance.  <a href="#af0b63e3e4525b64c5aca47933f04f929">More...</a><br /></td></tr>
<tr class="separator:af0b63e3e4525b64c5aca47933f04f929"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4f5ccf3fbaf50aee040a6dbaa3859447"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1formats.html#a4f5ccf3fbaf50aee040a6dbaa3859447">extract</a> (const std::type_info &amp;type, const <a class="el" href="classjsonv_1_1value.html">value</a> &amp;from, void *into, const <a class="el" href="classjsonv_1_1extraction__context.html">extraction_context</a> &amp;context) const </td></tr>
<tr class="memdesc:a4f5ccf3fbaf50aee040a6dbaa3859447"><td class="mdescLeft">&#160;</td><td class="mdescRight">Extract the provided <em>type</em> <em>from</em> a <code>value</code> <em>into</em> an area of memory.  <a href="#a4f5ccf3fbaf50aee040a6dbaa3859447">More...</a><br /></td></tr>
<tr class="separator:a4f5ccf3fbaf50aee040a6dbaa3859447"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8457bf42fe91f4b664b709c5993168f6"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classjsonv_1_1extractor.html">extractor</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1formats.html#a8457bf42fe91f4b664b709c5993168f6">get_extractor</a> (std::type_index type) const </td></tr>
<tr class="memdesc:a8457bf42fe91f4b664b709c5993168f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the <code>extractor</code> for the given <em>type</em>.  <a href="#a8457bf42fe91f4b664b709c5993168f6">More...</a><br /></td></tr>
<tr class="separator:a8457bf42fe91f4b664b709c5993168f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adf2e4f404fcbaca68e6831047e850758"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classjsonv_1_1extractor.html">extractor</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1formats.html#adf2e4f404fcbaca68e6831047e850758">get_extractor</a> (const std::type_info &amp;type) const </td></tr>
<tr class="memdesc:adf2e4f404fcbaca68e6831047e850758"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the <code>extractor</code> for the given <em>type</em>.  <a href="#adf2e4f404fcbaca68e6831047e850758">More...</a><br /></td></tr>
<tr class="separator:adf2e4f404fcbaca68e6831047e850758"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afd80a13509c2d95d3ea2053e57a85d8a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classjsonv_1_1value.html">value</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1formats.html#afd80a13509c2d95d3ea2053e57a85d8a">to_json</a> (const std::type_info &amp;type, const void *from, const <a class="el" href="classjsonv_1_1serialization__context.html">serialization_context</a> &amp;context) const </td></tr>
<tr class="memdesc:afd80a13509c2d95d3ea2053e57a85d8a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encode the provided value <em>from</em> into a JSON <code>value</code>.  <a href="#afd80a13509c2d95d3ea2053e57a85d8a">More...</a><br /></td></tr>
<tr class="separator:afd80a13509c2d95d3ea2053e57a85d8a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1b4f75998cebabcfd487eb984ed3f961"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classjsonv_1_1serializer.html">serializer</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1formats.html#a1b4f75998cebabcfd487eb984ed3f961">get_serializer</a> (std::type_index type) const </td></tr>
<tr class="memdesc:a1b4f75998cebabcfd487eb984ed3f961"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the <code>serializer</code> for the given <em>type</em>.  <a href="#a1b4f75998cebabcfd487eb984ed3f961">More...</a><br /></td></tr>
<tr class="separator:a1b4f75998cebabcfd487eb984ed3f961"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a85eb6124f29a0b3dac6852ca016757bd"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classjsonv_1_1serializer.html">serializer</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1formats.html#a85eb6124f29a0b3dac6852ca016757bd">get_serializer</a> (const std::type_info &amp;type) const </td></tr>
<tr class="memdesc:a85eb6124f29a0b3dac6852ca016757bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the <code>serializer</code> for the given <em>type</em>.  <a href="#a85eb6124f29a0b3dac6852ca016757bd">More...</a><br /></td></tr>
<tr class="separator:a85eb6124f29a0b3dac6852ca016757bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf6e36e4e7edc4702294a4e039113c62"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1formats.html#aaf6e36e4e7edc4702294a4e039113c62">register_extractor</a> (const <a class="el" href="classjsonv_1_1extractor.html">extractor</a> *, <a class="el" href="group__Serialization.html#ga645b8b2ddf86926dab927adb704ea352">duplicate_type_action</a> action=<a class="el" href="group__Serialization.html#gga645b8b2ddf86926dab927adb704ea352a42552b1f133f9f8eb406d4f306ea9fd1">duplicate_type_action::exception</a>)</td></tr>
<tr class="memdesc:aaf6e36e4e7edc4702294a4e039113c62"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register an <code>extractor</code> that lives in some unmanaged space.  <a href="#aaf6e36e4e7edc4702294a4e039113c62">More...</a><br /></td></tr>
<tr class="separator:aaf6e36e4e7edc4702294a4e039113c62"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a657e9796acf713616035029cea1c0c71"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1formats.html#a657e9796acf713616035029cea1c0c71">register_extractor</a> (std::shared_ptr&lt; const <a class="el" href="classjsonv_1_1extractor.html">extractor</a> &gt;, <a class="el" href="group__Serialization.html#ga645b8b2ddf86926dab927adb704ea352">duplicate_type_action</a> action=<a class="el" href="group__Serialization.html#gga645b8b2ddf86926dab927adb704ea352a42552b1f133f9f8eb406d4f306ea9fd1">duplicate_type_action::exception</a>)</td></tr>
<tr class="memdesc:a657e9796acf713616035029cea1c0c71"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register an <code>extractor</code> with shared ownership between this <code>formats</code> instance and anything else.  <a href="#a657e9796acf713616035029cea1c0c71">More...</a><br /></td></tr>
<tr class="separator:a657e9796acf713616035029cea1c0c71"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2cff39889701f38d7e09a05f01c5ebc7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1formats.html#a2cff39889701f38d7e09a05f01c5ebc7">register_serializer</a> (const <a class="el" href="classjsonv_1_1serializer.html">serializer</a> *, <a class="el" href="group__Serialization.html#ga645b8b2ddf86926dab927adb704ea352">duplicate_type_action</a> action=<a class="el" href="group__Serialization.html#gga645b8b2ddf86926dab927adb704ea352a42552b1f133f9f8eb406d4f306ea9fd1">duplicate_type_action::exception</a>)</td></tr>
<tr class="memdesc:a2cff39889701f38d7e09a05f01c5ebc7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register a <code>serializer</code> that lives in some managed space.  <a href="#a2cff39889701f38d7e09a05f01c5ebc7">More...</a><br /></td></tr>
<tr class="separator:a2cff39889701f38d7e09a05f01c5ebc7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a22c66da8ba0548592db9eac837a68862"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1formats.html#a22c66da8ba0548592db9eac837a68862">register_serializer</a> (std::shared_ptr&lt; const <a class="el" href="classjsonv_1_1serializer.html">serializer</a> &gt;, <a class="el" href="group__Serialization.html#ga645b8b2ddf86926dab927adb704ea352">duplicate_type_action</a> action=<a class="el" href="group__Serialization.html#gga645b8b2ddf86926dab927adb704ea352a42552b1f133f9f8eb406d4f306ea9fd1">duplicate_type_action::exception</a>)</td></tr>
<tr class="memdesc:a22c66da8ba0548592db9eac837a68862"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register a <code>serializer</code> with shared ownership between this <code>formats</code> instance and anything else.  <a href="#a22c66da8ba0548592db9eac837a68862">More...</a><br /></td></tr>
<tr class="separator:a22c66da8ba0548592db9eac837a68862"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a16bc06bd5f5d7e19794e6cdc48e2896d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1formats.html#a16bc06bd5f5d7e19794e6cdc48e2896d">register_adapter</a> (const <a class="el" href="classjsonv_1_1adapter.html">adapter</a> *, <a class="el" href="group__Serialization.html#ga645b8b2ddf86926dab927adb704ea352">duplicate_type_action</a> action=<a class="el" href="group__Serialization.html#gga645b8b2ddf86926dab927adb704ea352a42552b1f133f9f8eb406d4f306ea9fd1">duplicate_type_action::exception</a>)</td></tr>
<tr class="memdesc:a16bc06bd5f5d7e19794e6cdc48e2896d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register an <code>adapter</code> that lives in some unmanaged space.  <a href="#a16bc06bd5f5d7e19794e6cdc48e2896d">More...</a><br /></td></tr>
<tr class="separator:a16bc06bd5f5d7e19794e6cdc48e2896d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7cae54e894f01a72cd8b5af028f8998c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1formats.html#a7cae54e894f01a72cd8b5af028f8998c">register_adapter</a> (std::shared_ptr&lt; const <a class="el" href="classjsonv_1_1adapter.html">adapter</a> &gt;, <a class="el" href="group__Serialization.html#ga645b8b2ddf86926dab927adb704ea352">duplicate_type_action</a> action=<a class="el" href="group__Serialization.html#gga645b8b2ddf86926dab927adb704ea352a42552b1f133f9f8eb406d4f306ea9fd1">duplicate_type_action::exception</a>)</td></tr>
<tr class="memdesc:a7cae54e894f01a72cd8b5af028f8998c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register an <code>adapter</code> with shared ownership between this <code>formats</code> instance and anything else.  <a href="#a7cae54e894f01a72cd8b5af028f8998c">More...</a><br /></td></tr>
<tr class="separator:a7cae54e894f01a72cd8b5af028f8998c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2f8e8bdba52fd094cb34635015957df7"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1formats.html#a2f8e8bdba52fd094cb34635015957df7">operator==</a> (const <a class="el" href="classjsonv_1_1formats.html">formats</a> &amp;other) const </td></tr>
<tr class="memdesc:a2f8e8bdba52fd094cb34635015957df7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test for equality between this instance and <em>other</em>.  <a href="#a2f8e8bdba52fd094cb34635015957df7">More...</a><br /></td></tr>
<tr class="separator:a2f8e8bdba52fd094cb34635015957df7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab7e5f101767bb57e73c58a77deffa24c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1formats.html#ab7e5f101767bb57e73c58a77deffa24c">operator!=</a> (const <a class="el" href="classjsonv_1_1formats.html">formats</a> &amp;other) const </td></tr>
<tr class="memdesc:ab7e5f101767bb57e73c58a77deffa24c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test for inequality between this instance and <em>other</em>.  <a href="#ab7e5f101767bb57e73c58a77deffa24c">More...</a><br /></td></tr>
<tr class="separator:ab7e5f101767bb57e73c58a77deffa24c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:ad194791e293229fb6a79438a6444f51b"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classjsonv_1_1formats.html">formats</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1formats.html#ad194791e293229fb6a79438a6444f51b">defaults</a> ()</td></tr>
<tr class="memdesc:ad194791e293229fb6a79438a6444f51b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the default <code>formats</code> instance.  <a href="#ad194791e293229fb6a79438a6444f51b">More...</a><br /></td></tr>
<tr class="separator:ad194791e293229fb6a79438a6444f51b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4403758d5e87d0862a04fc5d9171991d"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classjsonv_1_1formats.html">formats</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1formats.html#a4403758d5e87d0862a04fc5d9171991d">global</a> ()</td></tr>
<tr class="memdesc:a4403758d5e87d0862a04fc5d9171991d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the global <code>formats</code> instance.  <a href="#a4403758d5e87d0862a04fc5d9171991d">More...</a><br /></td></tr>
<tr class="separator:a4403758d5e87d0862a04fc5d9171991d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a473ea49ef9d65f0f3af5fe5fd7e7e5c7"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classjsonv_1_1formats.html">formats</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1formats.html#a473ea49ef9d65f0f3af5fe5fd7e7e5c7">set_global</a> (<a class="el" href="classjsonv_1_1formats.html">formats</a>)</td></tr>
<tr class="memdesc:a473ea49ef9d65f0f3af5fe5fd7e7e5c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the <code>global</code> <code>formats</code> instance.  <a href="#a473ea49ef9d65f0f3af5fe5fd7e7e5c7">More...</a><br /></td></tr>
<tr class="separator:a473ea49ef9d65f0f3af5fe5fd7e7e5c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4e8870ecbecb357b2429632053665198"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classjsonv_1_1formats.html">formats</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1formats.html#a4e8870ecbecb357b2429632053665198">reset_global</a> ()</td></tr>
<tr class="memdesc:a4e8870ecbecb357b2429632053665198"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reset the <code>global</code> <code>formats</code> instance to <code>defaults</code>.  <a href="#a4e8870ecbecb357b2429632053665198">More...</a><br /></td></tr>
<tr class="separator:a4e8870ecbecb357b2429632053665198"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aee2ffa92a5678e6a24f8750e2c75884d"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classjsonv_1_1formats.html">formats</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1formats.html#aee2ffa92a5678e6a24f8750e2c75884d">coerce</a> ()</td></tr>
<tr class="memdesc:aee2ffa92a5678e6a24f8750e2c75884d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the coercing <code>formats</code> instance.  <a href="#aee2ffa92a5678e6a24f8750e2c75884d">More...</a><br /></td></tr>
<tr class="separator:aee2ffa92a5678e6a24f8750e2c75884d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae8fdc86436f8dcfd405753db55620110"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classjsonv_1_1formats.html">formats</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classjsonv_1_1formats.html#ae8fdc86436f8dcfd405753db55620110">compose</a> (const list &amp;bases)</td></tr>
<tr class="memdesc:ae8fdc86436f8dcfd405753db55620110"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new (empty) <code>formats</code> using the <em>bases</em> as backing <code>formats</code>.  <a href="#ae8fdc86436f8dcfd405753db55620110">More...</a><br /></td></tr>
<tr class="separator:ae8fdc86436f8dcfd405753db55620110"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Simply put, this class is a collection of <code>extractor</code> and <code>serializer</code> instances. </p>
<p>Ultimately, <code>formats</code> form a directed graph of possible types to load. This allows you to compose formats including your application with any number of 3rd party libraries an base formats. Imagine an application that has both a user facing API and an object storage system, both of which speak JSON. When loading from the database, you would like strict type enforcement &ndash; check that when you say <code>extract&lt;int&gt;(val)</code>, that <code>val</code> actually has <code>kind::integer</code>. When getting values from the API, you happily convert <code>kind::string</code> with the value <code>"51"</code> into the integer <code>51</code>. You really don't want to have to write two versions of decoders for all of your objects: one which uses the standard checked <code><a class="el" href="classjsonv_1_1value.html#aababe6acf36d6517205714b17b821ff8" title="Get this value as an integer. ">value::as_integer</a></code> and one that uses <code>coerce_integer</code> &ndash; you want the same object model.</p>
<div align="center">
<iframe scrolling="no" frameborder="0" src="dot_inline_dotgraph_2.svg" width="612" height="251"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
<p>To do this, you would create your object model (called <code>my_app_formats</code> in the chart) with the object models for your application-specific types. This can use any number of 3rd party libraries to get the job done. To make a functional <code>formats</code>, you would <code>compose</code> different <code>formats</code> instances into a single one. From there,</p>
<div class="fragment"><div class="line"><a class="code" href="classjsonv_1_1formats.html">jsonv::formats</a> get_api_formats()</div><div class="line">{</div><div class="line">    <span class="keyword">static</span> <a class="code" href="classjsonv_1_1formats.html">jsonv::formats</a> instance = <a class="code" href="classjsonv_1_1formats.html#ae8fdc86436f8dcfd405753db55620110">jsonv::formats::compose</a>({ <a class="code" href="classjsonv_1_1formats.html#aee2ffa92a5678e6a24f8750e2c75884d">jsonv::formats::coerce</a>(), get_app_formats() });</div><div class="line">    <span class="keywordflow">return</span> instance;</div><div class="line">}</div><div class="line"></div><div class="line"><a class="code" href="classjsonv_1_1formats.html">jsonv::formats</a> get_db_formats()</div><div class="line">{</div><div class="line">    <span class="keyword">static</span> <a class="code" href="classjsonv_1_1formats.html">jsonv::formats</a> instance = <a class="code" href="classjsonv_1_1formats.html#ae8fdc86436f8dcfd405753db55620110">jsonv::formats::compose</a>({ <a class="code" href="classjsonv_1_1formats.html#ad194791e293229fb6a79438a6444f51b">jsonv::formats::defaults</a>(), get_app_formats() });</div><div class="line">    <span class="keywordflow">return</span> instance;</div><div class="line">}</div><div class="line"></div><div class="line">MyType extract_thing(<span class="keyword">const</span> <a class="code" href="classjsonv_1_1value.html">jsonv::value</a>&amp; from, <span class="keywordtype">bool</span> from_db)</div><div class="line">{</div><div class="line">    <span class="keywordflow">return</span> jsonv::extract&lt;MyType&gt;(from, from_db ? get_db_formats() : get_api_formats());</div><div class="line">}</div></div><!-- fragment --> 
<p>Definition at line <a class="el" href="serialization_8hpp_source.html#l00321">321</a> of file <a class="el" href="serialization_8hpp_source.html">serialization.hpp</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="af0b63e3e4525b64c5aca47933f04f929"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">jsonv::formats::formats </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a new, empty <code>formats</code> instance. </p>
<p>By default, this does not know how to extract anything &ndash; not even the basic types like <code>int64_t</code> or <code>std::string</code>. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="aee2ffa92a5678e6a24f8750e2c75884d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classjsonv_1_1formats.html">formats</a> jsonv::formats::coerce </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get the coercing <code>formats</code> instance. </p>
<p>This uses <em>loose</em> type-checking and behaves by the same rules as the <code>coerce_</code> functions in <code><a class="el" href="coerce_8hpp.html" title="A jsonv::value has a number of as_X operators, which strictly performs a transformation to a C++ data...">coerce.hpp</a></code>.</p>
<dl class="section note"><dt>Note</dt><dd>This function actually returns a <em>copy</em> of the default <code>formats</code>, so modifications do not affect the actual instance. </dd></dl>

</div>
</div>
<a class="anchor" id="ae8fdc86436f8dcfd405753db55620110"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classjsonv_1_1formats.html">formats</a> jsonv::formats::compose </td>
          <td>(</td>
          <td class="paramtype">const list &amp;&#160;</td>
          <td class="paramname"><em>bases</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Create a new (empty) <code>formats</code> using the <em>bases</em> as backing <code>formats</code>. </p>
<p>This forms a directed graph of <code>formats</code> objects. When searching for an <code>extractor</code> or <code>serializer</code>, the <code>formats</code> is searched, then each base is searched depth-first left-to-right.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">bases</td><td>Is the list of <code>formats</code> objects to use as bases for the newly-created <code>formats</code>. Order matters &ndash; the <em>bases</em> are searched left-to-right, so <code>formats</code> that are farther left take precedence over those more to the right.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>It is impossible to form an endless loop of <code>formats</code> objects, since the base of all <code>formats</code> are eventually empty. If there is an existing set of nodes \( k \) and each new <code>format</code> created with <code>compose</code> is in \( k+1 \), there is no way to create a link from \( k \) into \( k+1 \) and so there is no way to create a circuit. </dd></dl>

</div>
</div>
<a class="anchor" id="ad194791e293229fb6a79438a6444f51b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classjsonv_1_1formats.html">formats</a> jsonv::formats::defaults </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get the default <code>formats</code> instance. </p>
<p>This uses <em>strict</em> type-checking and behaves by the same rules as the <code>value</code> <code>as_</code> member functions (<code>as_integer</code>, <code>as_string</code>, etc).</p>
<dl class="section note"><dt>Note</dt><dd>This function actually returns a <em>copy</em> of the default <code>formats</code>, so modifications do not affect the actual instance. </dd></dl>

</div>
</div>
<a class="anchor" id="a4f5ccf3fbaf50aee040a6dbaa3859447"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void jsonv::formats::extract </td>
          <td>(</td>
          <td class="paramtype">const std::type_info &amp;&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classjsonv_1_1value.html">value</a> &amp;&#160;</td>
          <td class="paramname"><em>from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>into</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classjsonv_1_1extraction__context.html">extraction_context</a> &amp;&#160;</td>
          <td class="paramname"><em>context</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Extract the provided <em>type</em> <em>from</em> a <code>value</code> <em>into</em> an area of memory. </p>
<p>The <em>context</em> is passed to the <code>extractor</code> which performs the conversion. In general, this should not be used directly as it is quite painful to do so &ndash; prefer <code><a class="el" href="classjsonv_1_1extraction__context.html#a10e56517662919b5316adcf26e2095bc" title="Attempt to extract a T from from using the formats associated with this context. ">extraction_context::extract</a></code> or the free function <code>jsonv::extract</code>.</p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname"><a class="el" href="classjsonv_1_1no__extractor.html" title="Thrown when formats::extract does not have an extractor for the provided type. ">no_extractor</a></td><td>if an <code>extractor</code> for <em>type</em> could not be found. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a8457bf42fe91f4b664b709c5993168f6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classjsonv_1_1extractor.html">extractor</a>&amp; jsonv::formats::get_extractor </td>
          <td>(</td>
          <td class="paramtype">std::type_index&#160;</td>
          <td class="paramname"><em>type</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the <code>extractor</code> for the given <em>type</em>. </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname"><a class="el" href="classjsonv_1_1no__extractor.html" title="Thrown when formats::extract does not have an extractor for the provided type. ">no_extractor</a></td><td>if an <code>extractor</code> for <em>type</em> could not be found. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="adf2e4f404fcbaca68e6831047e850758"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classjsonv_1_1extractor.html">extractor</a>&amp; jsonv::formats::get_extractor </td>
          <td>(</td>
          <td class="paramtype">const std::type_info &amp;&#160;</td>
          <td class="paramname"><em>type</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the <code>extractor</code> for the given <em>type</em>. </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname"><a class="el" href="classjsonv_1_1no__extractor.html" title="Thrown when formats::extract does not have an extractor for the provided type. ">no_extractor</a></td><td>if an <code>extractor</code> for <em>type</em> could not be found. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a1b4f75998cebabcfd487eb984ed3f961"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classjsonv_1_1serializer.html">serializer</a>&amp; jsonv::formats::get_serializer </td>
          <td>(</td>
          <td class="paramtype">std::type_index&#160;</td>
          <td class="paramname"><em>type</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the <code>serializer</code> for the given <em>type</em>. </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname"><a class="el" href="classjsonv_1_1no__serializer.html" title="Thrown when formats::to_json does not have a serializer for the provided type. ">no_serializer</a></td><td>if a <code>serializer</code> for <em>type</em> could not be found. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a85eb6124f29a0b3dac6852ca016757bd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classjsonv_1_1serializer.html">serializer</a>&amp; jsonv::formats::get_serializer </td>
          <td>(</td>
          <td class="paramtype">const std::type_info &amp;&#160;</td>
          <td class="paramname"><em>type</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the <code>serializer</code> for the given <em>type</em>. </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname"><a class="el" href="classjsonv_1_1no__serializer.html" title="Thrown when formats::to_json does not have a serializer for the provided type. ">no_serializer</a></td><td>if a <code>serializer</code> for <em>type</em> could not be found. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a4403758d5e87d0862a04fc5d9171991d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classjsonv_1_1formats.html">formats</a> jsonv::formats::global </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get the global <code>formats</code> instance. </p>
<p>By default, this is the same as <code>defaults</code>, but you can override it with <code>set_global</code>. The <code>extract</code> function uses this <code>formats</code> instance if none is provided, so this is convenient if your application only has one type of <code>formats</code> to use.</p>
<dl class="section note"><dt>Note</dt><dd>This function actually returns a <em>copy</em> of the global <code>formats</code>, so modifications do not affect the actual instance. If you wish to alter the global formats, use <code>set_global</code>. </dd></dl>

</div>
</div>
<a class="anchor" id="ab7e5f101767bb57e73c58a77deffa24c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool jsonv::formats::operator!= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classjsonv_1_1formats.html">formats</a> &amp;&#160;</td>
          <td class="paramname"><em>other</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Test for inequality between this instance and <em>other</em>. </p>
<p>The opposite of <code>operator==</code>. </p>

</div>
</div>
<a class="anchor" id="a2f8e8bdba52fd094cb34635015957df7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool jsonv::formats::operator== </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classjsonv_1_1formats.html">formats</a> &amp;&#160;</td>
          <td class="paramname"><em>other</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Test for equality between this instance and <em>other</em>. </p>
<p>If two <code>formats</code> are equal, they are the <em>exact</em> same node in the graph. Even if one <code>formats</code> has the exact same types for the exact same <code>extractor</code>s. </p>

</div>
</div>
<a class="anchor" id="a16bc06bd5f5d7e19794e6cdc48e2896d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void jsonv::formats::register_adapter </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classjsonv_1_1adapter.html">adapter</a> *&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__Serialization.html#ga645b8b2ddf86926dab927adb704ea352">duplicate_type_action</a>&#160;</td>
          <td class="paramname"><em>action</em> = <code><a class="el" href="group__Serialization.html#gga645b8b2ddf86926dab927adb704ea352a42552b1f133f9f8eb406d4f306ea9fd1">duplicate_type_action::exception</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Register an <code>adapter</code> that lives in some unmanaged space. </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname"><a class="el" href="classjsonv_1_1duplicate__type__error.html" title="Exception thrown if an insertion of an extractor or serializer into a formats is attempted, but there is already an extractor or serializer for that type. ">duplicate_type_error</a></td><td>if this <code>formats</code> instance already has either an <code>extractor</code> or <code>serializer</code> that serves the provided <code><a class="el" href="classjsonv_1_1extractor.html#a3595ea56dac959622735193c1768501f" title="Get the run-time type this extractor knows how to extract. ">adapter::get_type</a></code> and the <code>duplicate_type_action</code> is <code>exception</code>. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a7cae54e894f01a72cd8b5af028f8998c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void jsonv::formats::register_adapter </td>
          <td>(</td>
          <td class="paramtype">std::shared_ptr&lt; const <a class="el" href="classjsonv_1_1adapter.html">adapter</a> &gt;&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__Serialization.html#ga645b8b2ddf86926dab927adb704ea352">duplicate_type_action</a>&#160;</td>
          <td class="paramname"><em>action</em> = <code><a class="el" href="group__Serialization.html#gga645b8b2ddf86926dab927adb704ea352a42552b1f133f9f8eb406d4f306ea9fd1">duplicate_type_action::exception</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Register an <code>adapter</code> with shared ownership between this <code>formats</code> instance and anything else. </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname"><a class="el" href="classjsonv_1_1duplicate__type__error.html" title="Exception thrown if an insertion of an extractor or serializer into a formats is attempted, but there is already an extractor or serializer for that type. ">duplicate_type_error</a></td><td>if this <code>formats</code> instance already has either an <code>extractor</code> or <code>serializer</code> that serves the provided <code><a class="el" href="classjsonv_1_1extractor.html#a3595ea56dac959622735193c1768501f" title="Get the run-time type this extractor knows how to extract. ">adapter::get_type</a></code> the <code>duplicate_type_action</code> is <code>exception</code>. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aaf6e36e4e7edc4702294a4e039113c62"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void jsonv::formats::register_extractor </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classjsonv_1_1extractor.html">extractor</a> *&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__Serialization.html#ga645b8b2ddf86926dab927adb704ea352">duplicate_type_action</a>&#160;</td>
          <td class="paramname"><em>action</em> = <code><a class="el" href="group__Serialization.html#gga645b8b2ddf86926dab927adb704ea352a42552b1f133f9f8eb406d4f306ea9fd1">duplicate_type_action::exception</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Register an <code>extractor</code> that lives in some unmanaged space. </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname"><a class="el" href="classjsonv_1_1duplicate__type__error.html" title="Exception thrown if an insertion of an extractor or serializer into a formats is attempted, but there is already an extractor or serializer for that type. ">duplicate_type_error</a></td><td>if this <code>formats</code> instance already has an <code>extractor</code> that serves the provided <code><a class="el" href="classjsonv_1_1extractor.html#a3595ea56dac959622735193c1768501f" title="Get the run-time type this extractor knows how to extract. ">extractor::get_type</a></code> and the <code>duplicate_type_action</code> is <code>exception</code>. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a657e9796acf713616035029cea1c0c71"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void jsonv::formats::register_extractor </td>
          <td>(</td>
          <td class="paramtype">std::shared_ptr&lt; const <a class="el" href="classjsonv_1_1extractor.html">extractor</a> &gt;&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__Serialization.html#ga645b8b2ddf86926dab927adb704ea352">duplicate_type_action</a>&#160;</td>
          <td class="paramname"><em>action</em> = <code><a class="el" href="group__Serialization.html#gga645b8b2ddf86926dab927adb704ea352a42552b1f133f9f8eb406d4f306ea9fd1">duplicate_type_action::exception</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Register an <code>extractor</code> with shared ownership between this <code>formats</code> instance and anything else. </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname"><a class="el" href="classjsonv_1_1duplicate__type__error.html" title="Exception thrown if an insertion of an extractor or serializer into a formats is attempted, but there is already an extractor or serializer for that type. ">duplicate_type_error</a></td><td>if this <code>formats</code> instance already has an <code>extractor</code> that serves the provided <code><a class="el" href="classjsonv_1_1extractor.html#a3595ea56dac959622735193c1768501f" title="Get the run-time type this extractor knows how to extract. ">extractor::get_type</a></code> and the <code>duplicate_type_action</code> is <code>exception</code>. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a2cff39889701f38d7e09a05f01c5ebc7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void jsonv::formats::register_serializer </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classjsonv_1_1serializer.html">serializer</a> *&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__Serialization.html#ga645b8b2ddf86926dab927adb704ea352">duplicate_type_action</a>&#160;</td>
          <td class="paramname"><em>action</em> = <code><a class="el" href="group__Serialization.html#gga645b8b2ddf86926dab927adb704ea352a42552b1f133f9f8eb406d4f306ea9fd1">duplicate_type_action::exception</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Register a <code>serializer</code> that lives in some managed space. </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname"><a class="el" href="classjsonv_1_1duplicate__type__error.html" title="Exception thrown if an insertion of an extractor or serializer into a formats is attempted, but there is already an extractor or serializer for that type. ">duplicate_type_error</a></td><td>if this <code>formats</code> instance already has a <code>serializer</code> that serves the provided <code><a class="el" href="classjsonv_1_1serializer.html#ab66dee52dec1bbb163b1ba76e7243cee" title="Get the run-time type this serialize knows how to encode. ">serializer::get_type</a></code> and the <code>duplicate_type_action</code> is <code>exception</code>. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a22c66da8ba0548592db9eac837a68862"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void jsonv::formats::register_serializer </td>
          <td>(</td>
          <td class="paramtype">std::shared_ptr&lt; const <a class="el" href="classjsonv_1_1serializer.html">serializer</a> &gt;&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__Serialization.html#ga645b8b2ddf86926dab927adb704ea352">duplicate_type_action</a>&#160;</td>
          <td class="paramname"><em>action</em> = <code><a class="el" href="group__Serialization.html#gga645b8b2ddf86926dab927adb704ea352a42552b1f133f9f8eb406d4f306ea9fd1">duplicate_type_action::exception</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Register a <code>serializer</code> with shared ownership between this <code>formats</code> instance and anything else. </p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname"><a class="el" href="classjsonv_1_1duplicate__type__error.html" title="Exception thrown if an insertion of an extractor or serializer into a formats is attempted, but there is already an extractor or serializer for that type. ">duplicate_type_error</a></td><td>if this <code>formats</code> instance already has a <code>serializer</code> that serves the provided <code><a class="el" href="classjsonv_1_1serializer.html#ab66dee52dec1bbb163b1ba76e7243cee" title="Get the run-time type this serialize knows how to encode. ">serializer::get_type</a></code> and the <code>duplicate_type_action</code> is <code>exception</code>. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a4e8870ecbecb357b2429632053665198"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classjsonv_1_1formats.html">formats</a> jsonv::formats::reset_global </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Reset the <code>global</code> <code>formats</code> instance to <code>defaults</code>. </p>
<dl class="section return"><dt>Returns</dt><dd>the previous value of the global formats instance. </dd></dl>

</div>
</div>
<a class="anchor" id="a473ea49ef9d65f0f3af5fe5fd7e7e5c7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classjsonv_1_1formats.html">formats</a> jsonv::formats::set_global </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classjsonv_1_1formats.html">formats</a>&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Set the <code>global</code> <code>formats</code> instance. </p>
<dl class="section return"><dt>Returns</dt><dd>the previous value of the global formats instance. </dd></dl>

</div>
</div>
<a class="anchor" id="afd80a13509c2d95d3ea2053e57a85d8a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classjsonv_1_1value.html">value</a> jsonv::formats::to_json </td>
          <td>(</td>
          <td class="paramtype">const std::type_info &amp;&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>from</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classjsonv_1_1serialization__context.html">serialization_context</a> &amp;&#160;</td>
          <td class="paramname"><em>context</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Encode the provided value <em>from</em> into a JSON <code>value</code>. </p>
<p>The <em>context</em> is passed to the <code>serializer</code> which performs the conversion. In general, this should not be used directly as it is painful to do so &ndash; prefer <code><a class="el" href="classjsonv_1_1serialization__context.html#a4185f1964c08027f88500435583c7bb7" title="Convenience function for converting a C++ object into a JSON value. ">serialization_context::to_json</a></code> or the free function <code>jsonv::to_json</code>.</p>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname"><a class="el" href="classjsonv_1_1no__serializer.html" title="Thrown when formats::to_json does not have a serializer for the provided type. ">no_serializer</a></td><td>if a <code>serializer</code> for <em>type</em> could not be found. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>jsonv/<a class="el" href="serialization_8hpp_source.html">serialization.hpp</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>jsonv</b></li><li class="navelem"><a class="el" href="classjsonv_1_1formats.html">formats</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
